﻿/// <reference path="jquery-1.7.1-vsdoc.js" />
/// <reference path="jquery.form.js" />

function OnSuccess(result) {
    if (result.Msg != undefined) {
        alert(result.Msg);
    }
    if (result.Redirect != undefined) {
        window.location.href = result.Redirect;
    }
}

function Export(form, url, callback) {
    $("#"+form).ajaxSubmit({
        url: url,
        success: function (result) {
            if (result.hasdata != undefined && !result.hasdata) {
                alert("提示: 没有数据!");
            } else if (result.searcher != undefined) {
                //[get] file
                location.href = url + '?searcher=' + result.searcher;
            } else {
                $("#gridview").empty();
                $("#gridview").html(result);
            }
        }
    });
}